<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="formId" th:object="${Form}">
        <input type="hidden" name="id" th:value="*{id}">
        <input type="hidden" name="procInstanId" th:value="*{procInstanId}">
        <div class="form-group">
            <label class="col-sm-3 control-label">标题：</label>
            <div class="col-sm-8">
                <input name="title" th:value="*{title}" class="form-control" value="test" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">类型：</label>
            <div class="col-sm-8">
                <select name="leaveType" class="form-control select2-hidden-accessible">
                    <!--<option value=""></option>-->
                    <option th:field="*{leaveType}" value="0">事假</option>
                    <option th:field="*{leaveType}" value="1">病假</option>
                    <option th:field="*{leaveType}"  value="2">公假</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">审批人：</label>
            <div class="col-sm-8">
                <!--<input name="roomName" type="text" th:value="${roomName}"  class="form-control"/>-->
                <select readonly="readonly" name="agent_Id" class="form-control select2-hidden-accessible">
                    <!--<option value=""></option>-->
                    <option th:each="user:${users}" th:value="${user.uid}" th:text="${user.name}" th:field="*{agent_Id}"></option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">起始时间：</label>
            <div class="col-sm-8">
                <input readonly="readonly" th:value="*{#dates.format(leaveTime,'yyyy-MM-DD HH:mm:ss')}"  id="leaveTime" class="form-control" type="text" placeholder="yyyy-MM-DD HH:mm:ss">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">到期时间：</label>
            <div class="col-sm-8">
                <input readonly="readonly" th:value="*{#dates.format(expireTime,'yyyy-MM-DD HH:mm:ss')}" id="expireTime" class="form-control" type="text" placeholder="yyyy-MM-DD HH:mm:ss">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">理由：</label>
            <div class="col-sm-8">
                <textarea name="leaveContent" type="text" th:value="*{leaveContent}"
                          class="form-control"></textarea>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <label class="checkbox-inline i-checks">
                    <span th:if="*{status} eq '1' " class="btn btn-warning btn-xs ">预约中</span>
                    <span th:if="*{status} eq '2' " class="btn btn-success btn-xs ">同意请假</span>
                    <span th:if="*{status} eq '3' " class="btn btn-danger btn-xs ">拒绝请假</span>
                    <span th:if="*{status} eq '4' " class="btn btn-danger btn-xs ">放弃请假</span>
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">回复：</label>
            <div class="col-sm-8">
                <textarea readonly="readonly" type="text" th:text="*{reply}"
                          class="form-control"></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary">确定</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script type="text/javascript">

    var prefix = "/leave";
    $("#formId").validate({
        submitHandler: function(form) {
            $.operate.save(prefix + "/editSave", $('#formId').serializeArray());
        }
    });
</script>
</body>
</html>
